package cn.tom.tompicturebackend.service;


import cn.tom.tompicturebackend.model.dto.user.UserQueryRequest;
import cn.tom.tompicturebackend.model.entity.User;
import cn.tom.tompicturebackend.model.vo.LoginUserVo;

import cn.tom.tompicturebackend.model.vo.UserVo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author tom
*/
public interface UserService extends IService<User> {
    /**
     * 用户注册
     * @param userAccount
     * @param userPassword
     * @param checkPassword
     * @return
     */
    long userRegister(String userAccount, String userPassword,String checkPassword);

    /**
     * 用户登录
     * @param userAccount
     * @param userPassword
     * @param request
     * @return
     */
    LoginUserVo userLogin(String userAccount, String userPassword, HttpServletRequest  request);
    /**
     * 获取加密后的密码
     * @param userPassword
     * @return
     */
    String getEncryptPassword(String userPassword);

    /**
     * 用户信息脱敏
     * @param user
     * @return
     */
    LoginUserVo getLoginUserVo(User user);

    User getLoinUser(HttpServletRequest request);

    boolean userLogout(HttpServletRequest request);

    UserVo getUserVo(User user);

    List<UserVo> getUserVoList(List<User> userList);

    QueryWrapper<User> getQueryWrapper(UserQueryRequest userQueryRequest);

    /**
     * 是否管理员
     */
    boolean isAdmin(User user);

    User getLoginUser(HttpServletRequest request);

}
